var ss = null;
var lifet = null;
var logo = null;
var vdman = null;
var acct = null;

var mynt = null;
var ct = null;
var commandlauncher = null;

function setbutton(pparent, pvalue, ponclick, paccesskey)
{
	var myi = pparent.appendChild(document.createElement("input"));
	myi.setAttribute("type", "button");
	myi.setAttribute("onclick", "reflectactivearea('linktablearea');");
	myi.style.border = "none";
	myi.style.color = "blue";
	myi.style.background = "transparent";
	myi.setAttribute("value", pvalue);
	myi.setAttribute("onclick", ponclick);
	if(paccesskey)
	{
		myi.setAttribute("accesskey", paccesskey);
	}
	return myi;
}

function setupmenutable()
{
	var mya = document.getElementById("mainmenuarea");
	var t = mya.appendChild(document.createElement("table"));
	var r = t.appendChild(document.createElement("tr"));
	var d = r.appendChild(document.createElement("td"));
	setbutton(d, "Links", "reflectactivearea('linktablearea');", "l");
	setbutton(d, "Tables", "reflectactivearea('noticearea');", "t");
	setbutton(d, "liBrary", "reflectactivearea('vdman');", "b");
	setbutton(d, "aCcessutil", "reflectactivearea('acct');", "c");
	setbutton(d, "cOmmand", "commandlauncher.display();", "o");
	setbutton(d, "cover", "ss = new ScreenSaver('ssarea'); ss.display();");
	setbutton(d, "life", "lifet = new LifeTable('lifetablearea');");
	setbutton(d, "Menu", "mbar.show();", "m");
	setbutton(d, "close", "window.close();");
}

function onl()
{
	setupmenutable();
	ct = new CanvasT("linktablearea");
	ct.display();

	vdman = new VDTable("vdman");
	vdman.display();

	mynt = new NoticeT("noticearea");
	logo = new ManipulatorLogo("logoarea");

	acct = new AccTable("acct");
	acct.display();

	commandlauncher = new CommandTable("commandarea");
}

var areaids = new Array();
areaids.length = 0;
areaids[areaids.length] = "linktablearea";
areaids[areaids.length] = "noticearea";
areaids[areaids.length] = "vdman";
areaids[areaids.length] = "acct";

function reflectactivearea(pid)
{
	for(var icnt = 0; icnt < areaids.length; icnt++)
	{
		var mya = document.getElementById(areaids[icnt]);
		if(pid == areaids[icnt])
		{
			mya.style.display = "";
		}
		else
		{
			mya.style.display = "none";
		}
	}
}
